import re


def extract_procedure_name(sql_code):
    match = re.search(r"create PROCEDURE (\w+)\(", sql_code)
    if match:
        return match.group(1)
    else:
        return "Procedure name not found"

    # 使用函数


# sql_code = "create PROCEDURE p_test() BEGIN DECLARE a1 int;"
# procedure_name = extract_procedure_name(sql_code)
# print(procedure_name)